
#include "Thread.h"

Thread::Thread ( ) 
{
    m_TID		= 0 ;
    m_eStatus	= Thread::READY ;
}

Thread::~Thread () 
{
}

void Thread::Start() 
{ 
    if (m_eStatus != Thread::READY)
    {
        return ;
    }
    pthread_create(&m_TID,NULL,MyThreadProcess,this);
}


void Thread::Stop ()
{
}

void Thread::Exit(void* pRetval)
{
    pthread_exit(pRetval);
}

void* Thread::MyThreadProcess(void * pDerivedThread)
{
    Thread* pThread = (Thread *)pDerivedThread;
    if(pThread == NULL)
    {
        return NULL;
    }

    pThread->SetStatus(Thread::RUNNING);
    pThread->Run();
    pThread->SetStatus(Thread::EXIT);

    return NULL;
}

void Thread::Run( )
{
}

